package practice;

/**
 * Description:
 *
 * @Author cowen
 * @Create 2023/10/18 17:40
 * @Version 1.0
 */
class RandomArray{
    public static void main(String[] args) {
        int[] nums = new int[10];
        int MAX=0;
        int MIN=1000;
        int TOTAL=0;
        for (int i = 0; i < nums.length; i++) {
            int num =(int)(Math.random()*(99-10+1))+10;
            nums[i]=num;
            if(MAX<num){
                MAX=num;
            }
            if(MIN>num){
                MIN=num;
            }
            TOTAL+=num;
        }
        // 求最大值
        System.out.println("==========最大值为========");
        System.out.println(MAX);
        // 求最大值
        System.out.println("==========最小值为========");
        System.out.println(MIN);
        // 求平均值
        System.out.println("==========平均值为========");
        System.out.println(TOTAL/nums.length);
    }
}
